// 引入静态路由
import { constantRoutes } from '@/router'

// 静态路由
const state = {
  // 左侧的菜单列表
  routes: constantRoutes
}

const mutations = {
  // 添加动态路由
  setRoules(state, otherRoutes) {
    state.routes = [...constantRoutes, ...otherRoutes]
  }
}
const getters = {}
const actions = {}

// 导出的放下面，不然会遇到    [vuex] unknown mutation type: permission/setRoules 这种找不到的错误
export default {
  namespaced: true,
  state,
  mutations,
  getters,
  actions
}
